<!--
 * @Description:第二十九章（Vue3定义全局函数和变量）
 * @Author: IA ia@kepro.space
 * @Date: 2025-02-20 22:38:12
-->
<template>
  <div>
    <h1>第二十九章（Vue3定义全局函数和变量）</h1>
    <div>
      <h2>main.ts 注册全局变量</h2>
      <p>main.ts 注册的变量$env: {{ $env }}</p>
      <p>main.ts 注册的函数$filters:{{ $filters.format('ohohohoh') }}</p>
    </div>
  </div>
</template>
<script setup lang="ts">
import { ref, reactive, getCurrentInstance } from 'vue'

const app = getCurrentInstance()

console.log("app?.proxy?.$filters.format('ts'): ", app?.proxy?.$filters.format('ts'))
</script>
<style scoped></style>
